import 'package:kepu/model/animal_detail_entity.dart';
import 'package:kepu/util/http_util.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'animal_detail_provider.g.dart';

@riverpod
class AnimalDetailProvider extends _$AnimalDetailProvider {
  @override
  FutureOr<AnimalDetailData> build(int id) async {
    var response = await DioInstance.instance().get(path: "animal/$id");
    return AnimalDetailEntity.fromJson(response.data).data;
  }
}
